import { _decorator, Component, Node } from 'cc';
import { App } from '../../../App';
import { EventConst } from '../../../common/Common';
import { PD } from '../../../player/PlayerData';
import { TrainPlayBase } from './TrainPlayBase';
import UtilTool from '../../../tools/UtilTool';
const { ccclass, property } = _decorator;

export class GameTrainUser extends TrainPlayBase {
    onCue() {
        // UtilTool.printLog("mine onCue")

        this.gameLogic.cue.showCue()

        // let cueAngle = 30
        // let force = 100

        // this.gameLogic.cue.cueMoveAction(cueAngle, force)

    }

    posWhiteBall() {
        App.Event.emit(EventConst.POS_WHITE_BALL)
    }
    
    getName(): String {
        // return UtilTool.resolveUserName(PD.user.addressUrl)

        // * @param nickname:        昵称
        // * @param address:         地址
        // * @param addressLen:      地址保留显示的长度
        // * @param nickLen:         昵称保留显示的长度

        return UtilTool.formatNickOrAddress({"nickname":PD.user.nickname, "address":PD.user.addressUrl, "addressLen":6})
    }

}

